package com.imagesystem.system.service.impl;

import java.util.List;
import com.imagesystem.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.imagesystem.system.mapper.WashRecordMapper;
import com.imagesystem.system.domain.WashRecord;
import com.imagesystem.system.service.IWashRecordService;
import com.imagesystem.common.core.text.Convert;

/**
 * 内镜洗消记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-11
 */
@Service
public class WashRecordServiceImpl implements IWashRecordService 
{
    @Autowired
    private WashRecordMapper washRecordMapper;

    /**
     * 查询内镜洗消记录
     * 
     * @param washBatch 内镜洗消记录主键
     * @return 内镜洗消记录
     */
    @Override
    public WashRecord selectWashRecordByWashBatch(String washBatch)
    {
        return washRecordMapper.selectWashRecordByWashBatch(washBatch);
    }

    /**
     * 查询内镜洗消记录列表
     * 
     * @param washRecord 内镜洗消记录
     * @return 内镜洗消记录
     */
    @Override
    public List<WashRecord> selectWashRecordList(WashRecord washRecord)
    {
        return washRecordMapper.selectWashRecordList(washRecord);
    }

    /**
     * 新增内镜洗消记录
     * 
     * @param washRecord 内镜洗消记录
     * @return 结果
     */
    @Override
    public int insertWashRecord(WashRecord washRecord)
    {
        washRecord.setCreateTime(DateUtils.getNowDate());
        return washRecordMapper.insertWashRecord(washRecord);
    }

    /**
     * 修改内镜洗消记录
     * 
     * @param washRecord 内镜洗消记录
     * @return 结果
     */
    @Override
    public int updateWashRecord(WashRecord washRecord)
    {
        washRecord.setUpdateTime(DateUtils.getNowDate());
        return washRecordMapper.updateWashRecord(washRecord);
    }

    /**
     * 批量删除内镜洗消记录
     * 
     * @param washBatchs 需要删除的内镜洗消记录主键
     * @return 结果
     */
    @Override
    public int deleteWashRecordByWashBatchs(String washBatchs)
    {
        return washRecordMapper.deleteWashRecordByWashBatchs(Convert.toStrArray(washBatchs));
    }

    /**
     * 删除内镜洗消记录信息
     * 
     * @param washBatch 内镜洗消记录主键
     * @return 结果
     */
    @Override
    public int deleteWashRecordByWashBatch(String washBatch)
    {
        return washRecordMapper.deleteWashRecordByWashBatch(washBatch);
    }
}
